package com.ln.controller;

import com.ln.entity.AliKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/15 16:37
 */
@RestController
public class HiController {
    @GetMapping("/hi")
    public Map<String,Object> hi(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("name","王德发");
        map.put("address","北京");
        map.put("age",18);

        return map;
    }

    @Autowired
    private AliKey aliKey;

    @GetMapping("/message")
    public AliKey message(){
        return aliKey;
    }

    @Value("${server.port}")
    private Integer port;

    @Value("${student.name}")
    private String name;

    @GetMapping("one")
    public String one(){
        return "服务器的端口号:"+port+";姓名:"+name;
    }
}
